package com.billard.service.impl;

import com.billard.entity.Role;
import com.billard.mapper.RoleMapper;
import com.billard.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;


    @Override
    public List<Role> getRoles() {
        return roleMapper.selectAll();
    }

    @Override
    public void createRole(Role role) {
        roleMapper.insert(role);
    }

    @Override
    public void updateRole(Role role) {
        roleMapper.update(role);
    }

    @Override
    public void deleteRole(Long id) {
        roleMapper.deleteById(id);
    }
}
